#include "widget.h"
#include "ui_widget.h"

QThreadStorage<QString> Widget::storage;
void Widget::test(){
    storage.setLocalData("data_1");
    qDebug() << storage.localData();
    storage.setLocalData("data_2");///< 会覆盖 data_1
    qDebug() << storage.localData();
}

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    test();
}

Widget::~Widget()
{
    delete ui;
}

